﻿<%@ page language="java" contentType="text/html;charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html> 

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>我的订单</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css" type="text/css" />
		<script src="${pageContext.request.contextPath}/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="${pageContext.request.contextPath}/js/bootstrap.min.js" type="text/javascript"></script>
		<!-- 引入自定义css文件 style.css -->
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" type="text/css" />

		<style>
			body {
				margin-top: 20px;
				margin: 0 auto;
			}
			
			.carousel-inner .item img {
				width: 100%;
				height: 300px;
			}
		</style>
	</head>
	<script type="text/javascript">
	function callback() {
		alert("支付成功！")
	}
	</script>
	<body>

			
			<%@include file="head.jsp" %>

		<div class="container">
			<div class="row">

				<div style="margin:0 auto; margin-top:10px;width:950px;">
					<h2><strong>我的订单</strong></h2>
					<table class="table table-bordered">
					<c:forEach items="${o }" var="o">
						<tbody>
							<tr class="success">
								<th colspan="2">订单编号:${o.oid } </th>
								<th  colspan="2">
									<c:if test="${o.state == 0 }"><a onclick="callback()" href="${pageContext.request.contextPath}/order?method=callback&oid=${o.oid }">未付款</a></c:if>
									<c:if test="${o.state == 1 }">已付款</c:if>
									<c:if test="${o.state == 2 }">已发货</c:if>
									<c:if test="${o.state == 3 }">已完成</c:if>
								</th>
								<th colspan="1">总价:${o.total } </th>
								
							</tr>
							<tr class="warning">
								<th>图片</th>
								<th>商品</th>
								<th>价格</th>
								<th>数量</th>
								<th>小计</th>
							</tr>
							<c:forEach items="${o.items }" var="oi">
							<tr class="active">
								<td width="60" width="40%">
									<input type="hidden" name="id" value="22">
									<img src="${pageContext.request.contextPath}/${oi.product.pimage}" width="70" height="60">
								</td>
								<td width="30%">
									<a href="${pageContext.request.contextPath}/product?method=getById&pid=${oi.product.pid}" target="_blank" >${oi.product.pname }</a>
								</td>
								<td width="20%">
									￥${oi.product.shop_price }
								</td>
								<td width="10%">
									${oi.count }
								</td>
								<td width="15%">
									<span class="subtotal">￥${oi.subtotal }</span>
								</td>
							</tr>
							</c:forEach>
						</tbody>
						
					</c:forEach>
					</table>
				</div>
			</div>
			
		</div>
		<%@include file="/jsp/end.jsp" %>
	</body>

</html>